Create a new Parser for the given language. NOTE: It assumes that the language is compatible (uses set_language_nothrow).
Throws an error if the version of the given language is not compatible
Get the parser's current language.
Get the parser's current logger.
Use the parser to parse some source code and create a syntax tree.
Use the parser to parse some source code stored in one contiguous buffer. The first two parameters are the same as in the ts_parser_parse function above. The second two parameters indicate the location of the buffer and its length in bytes.
Use the parser to parse some source code stored in one contiguous buffer with a given encoding. The first four parameters work the same as in the ts_parser_parse_string method above. The final parameter indicates whether the text is encoded as UTF8 or UTF16.
Parse the given source_code that is in utf16 encoding
Parse the given source_code that is in utf8 encoding
Set the destination to which the parser should write debugging graphs during parsing. The graphs are formatted in the DOT language. You may want to pipe these graphs directly to a dot(1) process in order to generate SVG output.
Get the S-expression of the given source code
Set the language that the parser should use for parsing.
Set the language that the parser should use for parsing.
Stop the parser from printing debugging graphs while parsing.
Traverse the Tree starting from its root Node and print information about each
internal TSParser
A stateful object that this is used to produce a Tree based on some source code